﻿@using WebApp.ViewModels.Manage;
@model UserLoginModel

@{
    Layout = "~/Views/Shared/_DialogLayout.cshtml";
}

<div class="dialog-content" style="margin:8px; padding:20px 8px 8px 8px;">
    <table cellpadding="3" cellspacing="0" border="0" class="inputform">
        <tr>
            <td>
                <img src="~/Content/images/warning.png">
            </td>
            <td nowrap>
                <span class="color-red">                    
                    您的账号已在另一处登录，您可以选择重新登录或者退出系统。<br />如非本人操作，请立即通知客服人员！
                </span>
            </td>
        </tr>
    </table>
</div>
<div class="dialog-footer">
    <button id="btncancel" class="btn btn-small btn-default">退出系统</button>
    <button id="btnok" class="btn btn-small btn-primary">重新登录</button>
</div>

@section scripts {
<script type="text/javascript">
    $(document).ready(function () {
        $("#btncancel").click(function (e) {
            e.preventDefault();

            parent.dlglogin.close();
        });

        $("#btnok").click(function (e) {
            e.preventDefault();

            $.ajax({
                type: 'POST',
                url: baseurl + 'Member/Relogin',
                success: function (e) {
                    if (e.Ret == "0") {
                        parent.relogin = true;
                        parent.dlglogin.close();
                    }
                    else {
                        $.messager.alert(csms_lang.message_error, csms_lang.message_operation_failed, "error", function () {
                            parent.dlglogin.close();
                        });
                    }
                }
            });
        });
    });
</script>
} 